<form action="" class="top30 interview4W interview4Wlist">
    <table class="tableNew tableRaius" for="" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;">
        <tr>
            <td style="width: 189px!important;">楼盘名称</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['building_title'])?$InterviewTable['building_title']:'';?>" />
            </td>
            <td>建成日期</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['finished_date'])?$InterviewTable['finished_date']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>总层数</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['total_floor'])?$InterviewTable['total_floor']:'';?>" />
            </td>
            <td>所在层数</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['which_floor'])?$InterviewTable['which_floor']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>区位描述/周边氛围</td>
            <td colspan="3">
            	<pre><?= !empty($InterviewTable['surroundings'])?$InterviewTable['surroundings']:'';?></pre>
               <!-- <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['surroundings'])?$InterviewTable['surroundings']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>物业通达性</td>
            <td colspan="3">
            	<pre><?= !empty($InterviewTable['property'])?$InterviewTable['property']:'';?></pre>
            	
               <!-- <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['property'])?$InterviewTable['property']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>物业维护状况</td>
            <td colspan="3">
            	<pre><?= !empty($InterviewTable['property_state'])?$InterviewTable['property_state']:'';?></pre>
            	
               <!-- <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['property_state'])?$InterviewTable['property_state']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>目前状态</td>
            <td colspan="3">
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['whether_work'])?Yii::$app->params['whetherWork'][$InterviewTable['whether_work']]['name']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>租赁/租赁时间/租金缴纳</td>
            <td colspan="3">
            	<pre><?= !empty($InterviewTable['lease_info'])?$InterviewTable['lease_info']:'';?></pre>
            </td>
        </tr>
        <tr>
            <td>是否业主唯一住房</td>
            <td colspan="3">
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['is_only'])==1?"是":'否';?>" />
            </td>
            
        </tr>
        <tr>
        	<td>业主还款意愿</td>
            <td colspan="3">
            	<pre><?= !empty($InterviewTable['willing'])?$InterviewTable['willing']:'';?></pre>
               <!-- <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['willing'])?$InterviewTable['willing']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>市场走访价格（售价/套）</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['market_price'])?$InterviewTable['market_price']:'';?>" />
            </td>
            <td>市场走访租金</td>
            <td>
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['market_rent_price'])?$InterviewTable['market_rent_price']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>可比物业1</td>
            <td>
            	<pre><?= !empty($InterviewTable['comparison_property1'])?$InterviewTable['comparison_property1']:'';?></pre>
            	
               <!-- <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['comparison_property1'])?$InterviewTable['comparison_property1']:'';?>" />-->
            </td>
            <td>可比物业2</td>
            <td>
            	<pre><?= !empty($InterviewTable['comparison_property2'])?$InterviewTable['comparison_property2']:'';?></pre>
                <!--<input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['comparison_property2'])?$InterviewTable['comparison_property2']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>可比物业3</td>
            <td>
            	<pre><?= !empty($InterviewTable['comparison_property3'])?$InterviewTable['comparison_property3']:'';?></pre>
                <!--<input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['comparison_property3'])?$InterviewTable['comparison_property3']:'';?>" />-->
            </td>
            <td>可比物业4</td>
            <td>
            	<pre><?= !empty($InterviewTable['comparison_property4'])?$InterviewTable['comparison_property4']:'';?></pre>
                <!--<input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['comparison_property4'])?$InterviewTable['comparison_property4']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>走访信息来源</td>
            <td colspan="3">
            	<pre><?= !empty($InterviewTable['info_origin'])?$InterviewTable['info_origin']:'';?></pre>
               <!-- <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['info_origin'])?$InterviewTable['info_origin']:'';?>" />-->
            </td>
            
        </tr>
        <tr>
        	<td>联系方式</td>
            <td colspan="3">
                <input style="padding-left: 0;" type="text" readonly="readonly" name="" id="" title="内容提示" value="<?= !empty($InterviewTable['contact'])?$InterviewTable['contact']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>备注说明</td>
            <td colspan="3">
            	<pre><?= !empty($InterviewTable['remark'])?$InterviewTable['remark']:'';?></pre>
            </td>
        </tr>
    </table>
</form>
<form action="" id="xianChangFangTan" class="interview4Edit borderColor" style="display: none;">
    <input type="text" hidden value="<?= !empty($ppseid)?$ppseid:0;?>" id="ppseid4">
    <table class="tableNew  editTable radioYn tableEdit7 " for="" border="0" cellspacing="0" cellpadding="0" style="border-collapse:separate;border-spacing: 0;border: none;">
        <tr>
            <td>楼盘名称</td>
            <td>
                <input type="text" name="" id="building_title" value="<?= !empty($InterviewTable['building_title'])?$InterviewTable['building_title']:'';?>" />
            </td>
            <td>建成日期</td>
            <td>
                <input type="text" name="" id="finished_date" value="<?= !empty($InterviewTable['finished_date'])?$InterviewTable['finished_date']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>总层数</td>
            <td>
                <input type="text" name="" id="total_floor" value="<?= !empty($InterviewTable['total_floor'])?$InterviewTable['total_floor']:'';?>" />
            </td>
            <td>所在层数</td>
            <td>
                <input type="text" name="" id="which_floor" value="<?= !empty($InterviewTable['which_floor'])?$InterviewTable['which_floor']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>区位描述/周边氛围</td>
            <td colspan="3">
                <textarea name="" rows="" cols="" class="textarea-edit" id="surroundings"><?= !empty($InterviewTable['surroundings'])?$InterviewTable['surroundings']:'';?></textarea>
            </td>
        </tr>
        <tr>
            <td>物业通达性</td>
            <td colspan="3">
                <textarea name="" rows="" cols="" class="textarea-edit" id="property"><?= !empty($InterviewTable['property'])?$InterviewTable['property']:'';?></textarea>
            </td>
        </tr>
        <tr>
            <td>物业维护状况</td>
            <td colspan="3">
                <textarea name="" rows="" class="textarea-edit" id="property_state"><?= !empty($InterviewTable['property_state'])?$InterviewTable['property_state']:'';?></textarea>
            </td>
        </tr>
        <tr>
            <td>目前状态</td>
            <td colspan="3" class="muQianZhuangTai">
                <?php
                $whetherWork = Yii::$app->params['whetherWork'];
                foreach ($whetherWork as $k => $v){
                    $for = $v['for'];
                    $name = $v['name'];
                    $id = $v['val'];
                    if (!empty($InterviewTable['whether_work']) && $InterviewTable['whether_work']==$v['val'] ){
                        echo <<<ZT
                            <label for="$for" class="">
                                <span class="yesActive">$name</span>
                                <input type="radio" checked="checked" class="yes hidden" data-val='$id' name = 'zhuangTai' id ="$for" />
                            </label>
ZT;
                    }else{
                        echo <<<ZT1
                            <label for="$for" class="">
                                <span class="noActive">$name</span>
                                <input type="radio" checked="checked" class="yes hidden" data-val='$id' name = 'zhuangTai' id ="$for" />
                            </label>
ZT1;
                    }
                }
                ?>
            </td>
        </tr>
        <tr class="zuLinTr" style="">
            <td>租赁租赁时间/租金缴纳</td>
            <td colspan="3">
                <textarea name="" rows="" cols="" class="textarea-edit" id="lease_info_text"><?= !empty($InterviewTable['lease_info'])?$InterviewTable['lease_info']:'';?></textarea>
            </td>
        </tr>
        <tr>
            <td>是否业主唯一住房</td>
            <td colspan="3" class="ynZhufang">
                <label for="zhuFangYes">
                    <span class="<?=!empty($InterviewTable['is_only'])&&$InterviewTable['is_only']==1?'yesActive':'noActive'?>">是</span>
                    <input type="radio" checked="checked" class="yes hidden" data-val="1" name = 'zhuFang' id ="zhuFangYes" />
                </label>
                <label for="zhuFangNo">
                    <span class="<?=!empty($InterviewTable['is_only'])&&$InterviewTable['is_only']==2?'yesActive':'noActive'?>">否</span>
                    <input type="radio"  class="hidden" name = 'zhuFang' data-val="2" id="zhuFangNo" />
                </label>
            </td>
        </tr>
        <tr>
            <td>业主还款意愿</td>
            <td colspan="3">
                <textarea name="" rows="" cols="" class="textarea-edit" id="willing"><?= !empty($InterviewTable['willing'])?$InterviewTable['willing']:'';?></textarea>
            </td>
        </tr>
        <tr>
            <td>市场走访价格（售价/套）</td>
            <td class="yz">
                <input type="text" isNumber='true' onkeydown="true" name="" id="market_price" value="<?= !empty($InterviewTable['market_price'])?$InterviewTable['market_price']:'';?>" />
            </td>
            <td>市场走访租金</td>
            <td class="yz">
                <input type="text" isNumber='true' onkeydown="true" name="" id="market_rent_price" value="<?= !empty($InterviewTable['market_rent_price'])?$InterviewTable['market_rent_price']:'';?>" />
            </td>
        </tr>
        <tr>
            <td>可比物业1</td>
            <td>
            	<textarea name="" rows="" cols="" class="textarea-edit" id="comparison_property1" style="border: 1px solid rgb(226, 226, 226); height: 84.5px;"><?= !empty($InterviewTable['comparison_property1'])?$InterviewTable['comparison_property1']:'';?></textarea>
                <!--<input type="text" name="" id="comparison_property1" value="<?= !empty($InterviewTable['comparison_property1'])?$InterviewTable['comparison_property1']:'';?>" />-->
            </td>
            <td>可比物业2</td>
            <td>
            	<textarea name="" rows="" cols="" class="textarea-edit" id="comparison_property2" style="border: 1px solid rgb(226, 226, 226); height: 84.5px;"><?= !empty($InterviewTable['comparison_property2'])?$InterviewTable['comparison_property2']:'';?></textarea>
               <!-- <input type="text" name="" id="comparison_property2" value="<?= !empty($InterviewTable['comparison_property2'])?$InterviewTable['comparison_property2']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>可比物业3</td>
            <td>
            	<textarea name="" rows="" cols="" class="textarea-edit" id="comparison_property3" style="border: 1px solid rgb(226, 226, 226); height: 84.5px;"><?= !empty($InterviewTable['comparison_property3'])?$InterviewTable['comparison_property3']:'';?></textarea>
                <!--<input type="text" name="" id="comparison_property3" value="<?= !empty($InterviewTable['comparison_property3'])?$InterviewTable['comparison_property3']:'';?>" />-->
            </td>
            <td>可比物业4</td>
            <td>
            	<textarea name="" rows="" cols="" class="textarea-edit" id="comparison_property4" style="border: 1px solid rgb(226, 226, 226); height: 84.5px;"><?= !empty($InterviewTable['comparison_property4'])?$InterviewTable['comparison_property4']:'';?></textarea>
                <!--<input type="text" name="" id="comparison_property4" value="<?= !empty($InterviewTable['comparison_property4'])?$InterviewTable['comparison_property4']:'';?>" />-->
            </td>
        </tr>
        <tr>
            <td>走访信息来源</td>
            <td colspan="3">
            	<textarea name="" rows="" cols="" class="textarea-edit" id="info_origin" style="border: 1px solid rgb(226, 226, 226); height: 84.5px;"><?= !empty($InterviewTable['info_origin'])?$InterviewTable['info_origin']:'';?></textarea>
                <!--<input type="text" name="" id="info_origin" value="<?= !empty($InterviewTable['info_origin'])?$InterviewTable['info_origin']:'';?>" />-->
            </td>
            
        </tr>
        <tr>
        	<td>联系方式</td>
            <td colspan="3">
                <input type="text" name="" id="contact" value="<?= !empty($InterviewTable['contact'])?$InterviewTable['contact']:'';?>" />
            </td>
        	
        </tr>
        <tr>
            <td>备注说明</td>
            <td colspan="3">
                <textarea name="" rows="" cols="" class="textarea-edit" id="remark"><?= !empty($InterviewTable['remark'])?$InterviewTable['remark']:'';?></textarea>
            </td>
        </tr>
    </table>
    <div class="cancelInConfirm clearfix">
        <input id="ajaxMortgageInterview" class="cancelInConfirmActive" type="button" value="保存" />
        <input id='cancelInterview' type="button" value="取消" />
    </div>
</form>
<!-- textarea 高度设置对比div -->

<div style="max-height: 1px; overflow: hidden;">
	
	<div id="d1" style="visibility:hidden;min-height: 80px;"></div>

</div>
<script>
    $(function () {
    		// textarea 高度展示问题
	    $(".textarea-edit").keyup(function(){
	      var val = $(this).val();
	      $("#d1").html("<pre>" +val+" "+"</pre>");
	      var h = $("#d1").height() ;
	      $(this).height(h);
	    });
        var mortgage_id = $("#mortgage_id").val();
        $("#ajaxMortgageInterview").click(function () {
            var building_title = $("#building_title").val();
            var finished_date = $("#finished_date").val();
            var total_floor = $("#total_floor").val();
            var which_floor = $("#which_floor").val();
            var surroundings = $("#surroundings").val();
            var property = $("#property").val();
            var property_state = $("#property_state").val();
            var lease_info = $("#lease_info_text").val();
            var willing = $("#willing").val();
            var market_price = $("#market_price").val();
            var market_rent_price = $("#market_rent_price").val();
            var comparison_property1 = $("#comparison_property1").val();
            var comparison_property2 = $("#comparison_property2").val();
            var comparison_property3 = $("#comparison_property3").val();
            var comparison_property4 = $("#comparison_property4").val();
            var info_origin = $("#info_origin").val();
            var contact = $("#contact").val();
            var remark = $("#remark").val();
            var ppseid4 = $("#ppseid4").val();
            var is_only = $("#zhuFangNo").prev().attr('class')=='yesActive'?2:1;
            var whether_work = 0;
            $(".muQianZhuangTai label").each(function (i,v) {
                if ($(this).find('span').attr('class')=='yesActive'){
                    whether_work = $(this).find('span').next().data('val')
                }
            })
            var Pdtat = {
                'building_title' : building_title,
                'finished_date' : finished_date,
                'total_floor' : total_floor,
                'which_floor' : which_floor,
                'surroundings' : surroundings,
                'property' : property,
                'property_state' : property_state,
                'lease_info' : lease_info,
                'willing' : willing,
                'market_price' : market_price,
                'market_rent_price' : market_rent_price,
                'comparison_property1' : comparison_property1,
                'comparison_property2' : comparison_property2,
                'comparison_property3' : comparison_property3,
                'comparison_property4' : comparison_property4,
                'info_origin' : info_origin,
                'contact': contact,
                'remark': remark,
                'is_only':is_only,
                'whether_work':whether_work,
                'mortgage_id' : mortgage_id,
                'ppseid':ppseid4,
            }
            var url = '/project/ajax-save-mortgage-interview-table-project';
            $.post(url,{data:Pdtat,mortgage_id:mortgage_id},function (res) {
                if(res){
                    layer.msg('保存成功')
                    interview4W();
                }else{
                    layer.msg('保存失败')
                }
            })
        })
        //-----------------渲染无编辑页面--------------------
        function interview4W() {
            var ppseid4 = $("#ppseid4").val();
            $.get('/project/get-mortgage-view-table',{'project_id':project_id,'postion':4,'mortgage_id':mortgage_id,"ppseid":ppseid4},function (res) {
                $(".interview4W").remove();
                $(".interview4Edit").remove();
                $("#fangtan4").before(res);
                $("#getInterview4").show();
            })
        }
        //-----取消保存按钮
        $("#cancelInterview").click(function () {
            var ppseid4 = $("#ppseid4").val();
            $.post('/project/ajax-un-lock',{'postion':114,'ppesid':ppseid4,},function (res) {
                var JSONData = JSON.parse(res)
                if (JSONData.code == 200){
                    layer.msg(JSONData.message);
                }else{
                    layer.msg(JSONData.message);
                }
            });
            $(".interview4Edit").hide();
            $(".interview4W").show();
        })
        //----目前状态
        //是否样式切换 (目前状态切换样式  是否业主唯一住房)
        $('.radioYn input[type="radio"]').on('click', function() {
            $(this).prev().addClass('yesActive').removeClass('noActive');
            $(this).parent().siblings().find('span').removeClass('yesActive').addClass('noActive');
            //	租赁被选中后展示租赁列表zuLin
            if($('#zuLin').is(':checked')){
                $('.zuLinTr').show()
            }else{
                $('.zuLinTr').hide()
            }
        })
        //------是否业主唯一住房
        $("#zhuFangYes").click(function () {
            $("#zhuFangYes").prev().attr('class','yesActive')
            $("#zhuFangNo").prev().attr('class','noActive')
        })
        $("#zhuFangNo").click(function () {
            $("#zhuFangYes").prev().attr('class','noActive')
            $("#zhuFangNo").prev().attr('class','yesActive')
        })
    })
    
    
    	 //高亮显示开始
         $(document).on("focus",'textarea',function(){
				$(this).css({
							'border':'1px solid #2194f1'
				})
			})
		$(document).on("blur",'textarea',function(){
			$(this).css({
						'border':'1px solid #e2e2e2'
			})
		})
		
		 $(".borderColor").on("focus",'input',function(){
				$(this).css({
							'border':'1px solid #2194f1'
				})
			})
		$(".borderColor").on("blur",'input',function(){
			$(this).css({
						'border':'1px solid #e2e2e2'
			})
		})
		 $(".borderColor").on("focus",'select',function(){
				$(this).css({
							'border':'1px solid #2194f1'
				})
			})
		$(".borderColor").on("blur",'select',function(){
			$(this).css({
						'border':'1px solid #e2e2e2'
			})
		})
    	//高亮显示结束
</script>